import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path:"/total",
    component:() => import("../views/total"),
    children:[
      {
        path:"home",
        component:() => import('../views/total/Home'),
      },
      {
        path:"order",
        component:() => import('../views/total/Order'),
      },
      {
        path:"customer",
        component:() => import('../views/total/Customer'),
      },
      {
        path:"my",
        component:() => import('../views/total/My'),
      },
      {
        path:'',
        redirect:"/total/home"
      }
    ]
  },
  {
    path:'/login',
    component: () => import("../views/Login")
  },
  {
    path:"/register",
    component:() => import('../views/Register')
  },
  {
    path:"/search",
    component:() => import('../views/total/Search')
  },
  {
    path:"/ticketDetail",
    component:() => import('../views/total/TicketDetail')
  },
  {
    path: "/",
    redirect: "/total"
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
